@extends('layouts.app')
<style>
    #d2{
        display: none;
    }
</style>
@section('content')
    <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span1">列表</span>
    <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span2">添加</span>
    <div id="d1">
        <table class="layui-table">
            <thead>
            <tr>
                <th>
                    排序
                </th>
                <th>
                    ID
                </th>
                <th>
                    名称
                </th>
                <th>
                    所需钻石/月
                </th>
                <th>
                    图标
                </th>
                <th>
                    发布时间
                </th>
                <th>
                    操作
                </th>
            </tr>
            </thead>
            <tbody>
                @foreach($info as $key=>$r)
                <tr>
                        <td>{{$r->serial}}</td>
                        <td>{{$r->id}}</td>
                        <td>{{$r->filename}}</td>
                        <td>{{$r->mount_needcoin}}</td>
                        <td><img src="{{$r->images}}" alt="" width="50px" height="50px"></td>
                        <td>{{$r->c_imgtime}}</td>
                        <td><a href="mount_edit/{{$r->id}}">编辑</a>|<a href="mount_delete/{{$r->id}}">删除</a></td>
                </tr>
                @endforeach
            </tbody>
        </table>
    </div>
    <div id="d2">
        <form action="{{url('mount_add')}}" method="post" enctype="multipart/form-data">
            {{csrf_field()}}
            <label class="login-title" for="username">序号</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="serial" lay-verify="required" placeholder="请输入ID" autocomplete="off" class="layui-input" value="0">
                </div>
            </div>
            <label class="login-title" for="username">名称</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="filename" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <label class="login-title" for="username">所需钻石</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="mount_needcoin" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <label class="login-title" for="username">图片</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="file" name="images" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <label class="login-title" for="username">动画（GIF）</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="file" name="gif_images" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <label class="login-title" for="username">动画时长</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="images_time" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                </div>
            </div>
            <label class="login-title" for="username">进场话术</label>
            <div class="layui-form-item">
                <div class="layui-input-inline login-inline">
                    <input type="text" name="images_see" lay-verify="required" id="c_time" autocomplete="off" class="layui-input" >
                    *实际效果为用户昵称+进场话术*
                </div>
            </div>
            <input type="submit" value="添加" class="btn btn-warning pull-right" lay-submit lay-filter="login">
            <span class="btn btn-warning pull-right" lay-submit lay-filter="login"><a href="{{url('mount_show')}}">返回</a></span>
        </form>
    </div>
@endsection
<script src="jquery.js"></script>
<script>
    $(document).on("click","#span2",function(){
        if($("#d2").css("display")=="none"){
            $("#d2").css("display","block");
            $("#d1").css("display","none");
        }else{
            $("#d2").css("display","none");
            $("#d1").css("display","block");
        }
    })
    $(document).on("click","#span1",function(){
        if($("#d1").css("display")=="none"){
            $("#d1").css("display","block");
            $("#d2").css("display","none");
        }else{
            $("#d1").css("display","none");
            $("#d2").css("display","block");
        }
    })
</script>